//package com.axin.common.core.config;
//
//import cn.hutool.core.util.StrUtil;
//import org.springframework.context.annotation.Bean;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.util.Locale;
//
///**
// * 国际化配置
// *
// * @Author axin
// * @Date 2021/10/17 23:25
// **/
//public class I18nConfig {
//
//    @Bean
//    public LocaleResolver localeResolver() {
//        return new I18nLocaleResolver();
//    }
//
//    /**
//     * 获取请求头国际化信息
//     */
//    static class I18nLocaleResolver implements LocaleResolver {
//
//        @NotNull
//        @Override
//        public Locale resolveLocale(HttpServletRequest httpServletRequest) {
//            String language = httpServletRequest.getHeader("content-language");
//            Locale locale = Locale.getDefault();
//            if (StrUtil.isNotBlank(language)) {
//                String[] split = language.split("_");
//                locale = new Locale(split[0], split[1]);
//            }
//            return locale;
//        }
//
//        @Override
//        public void setLocale(@NotNull HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) {
//
//        }
//    }
//}
